package edu.sias.course.service.impl;

import java.util.List;

import edu.sias.course.domain.pojo.CourseContent;
import edu.sias.course.mapper.CourseContentMapper;
import edu.sias.course.service.ICourseContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 课程内容Service业务层处理
 *
 * @author 若依
 * @date 2023-10-10
 */
@Service
public class CourseContentServiceImpl implements ICourseContentService {

    @Autowired
    private CourseContentMapper courseContentMapper;

    /**
     * 查询课程内容
     */
    @Override
    public CourseContent getCourseContentById(Long id) {
        return courseContentMapper.selectCourseContentById(id);
    }

    /**
     * 查询课程内容列表
     */
    @Override
    public List<CourseContent> listCourseContent(CourseContent courseContent) {
        return courseContentMapper.selectCourseContentList(courseContent);
    }

    /**
     * 新增课程内容
     */
    @Override
    public int addCourseContent(CourseContent courseContent) {
        return courseContentMapper.insertCourseContent(courseContent);
    }

    /**
     * 修改课程内容
     */
    @Override
    public int updateCourseContent(CourseContent courseContent) {
        return courseContentMapper.updateCourseContent(courseContent);
    }

    /**
     * 删除课程内容
     */
    @Override
    public int removeCourseContentById(Long id) {
        return courseContentMapper.deleteCourseContentById(id);
    }
}
